/*
 Navicat Premium Data Transfer

 Source Server         : 120.77.159.227
 Source Server Type    : MySQL
 Source Server Version : 50638
 Source Host           : 120.77.159.227:3306
 Source Schema         : test

 Target Server Type    : MySQL
 Target Server Version : 50638
 File Encoding         : 65001

 Date: 02/04/2018 18:29:34
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for admin_log
-- ----------------------------
DROP TABLE IF EXISTS `admin_log`;
CREATE TABLE `admin_log` (
  `log_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
  `description` varchar(100) DEFAULT NULL COMMENT '操作描述',
  `username` varchar(20) DEFAULT NULL COMMENT '操作用户',
  `start_time` datetime DEFAULT NULL COMMENT '操作时间',
  `spend_time` datetime DEFAULT NULL COMMENT '消耗时间',
  `base_path` varchar(500) DEFAULT NULL COMMENT '根路径',
  `uri` varchar(500) DEFAULT NULL COMMENT 'URI',
  `url` varchar(500) DEFAULT NULL COMMENT 'URL',
  `method` varchar(10) DEFAULT NULL COMMENT '请求类型',
  `parameter` mediumtext,
  `user_agent` varchar(500) DEFAULT NULL COMMENT '用户标识',
  `ip` varchar(30) DEFAULT NULL COMMENT 'IP地址',
  `result` mediumtext,
  `permissions` varchar(100) DEFAULT NULL COMMENT '权限值',
  PRIMARY KEY (`log_id`),
  KEY `log_id` (`log_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='操作日志';

-- ----------------------------
-- Table structure for admin_permission
-- ----------------------------
DROP TABLE IF EXISTS `admin_permission`;
CREATE TABLE `admin_permission` (
  `permission_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `pid` int(10) DEFAULT NULL COMMENT '所属上级',
  `name` varchar(20) DEFAULT NULL COMMENT '名称',
  `type` tinyint(4) DEFAULT NULL COMMENT '类型(1:目录,2:菜单,3:按钮)',
  `permission_value` varchar(255) DEFAULT NULL COMMENT '权限值',
  `uri` varchar(255) DEFAULT NULL COMMENT '路径',
  `icon` varchar(50) DEFAULT NULL COMMENT '图标',
  `status` tinyint(4) DEFAULT NULL COMMENT '状态(0:禁止,1:正常)',
  `ctime` datetime DEFAULT NULL COMMENT '创建时间',
  `orders` bigint(20) DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`permission_id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COMMENT='权限';

-- ----------------------------
-- Records of admin_permission
-- ----------------------------
BEGIN;
INSERT INTO `admin_permission` VALUES (3, 0, '系统设置', 1, '', '', 'larry-xitong', 1, '2018-03-30 16:39:09', NULL);
INSERT INTO `admin_permission` VALUES (4, 3, '后台首页', 1, '', '/main', '', 1, '2018-03-30 17:57:25', NULL);
INSERT INTO `admin_permission` VALUES (5, 20, '权限管理', 2, 'backend_system_upms_permissions_index', '/backend/system/upms/permissions/index', 'larry-quanxianguanli3', 1, '2018-03-30 16:42:10', NULL);
INSERT INTO `admin_permission` VALUES (6, 5, '添加根菜单', 3, 'backend_system_upms_permissions_add', '/backend/system/upms/permissions/add', '', 1, '2018-03-30 16:42:54', NULL);
INSERT INTO `admin_permission` VALUES (7, 5, '添加子菜单', 3, 'backend_system_upms_permissions_addPermissions', '/backend/system/upms/permissions/addPermissions', '', 1, '2018-03-30 16:43:38', NULL);
INSERT INTO `admin_permission` VALUES (8, 5, '编辑', 3, 'backend_system_upms_permissions_edit', '/backend/system/upms/permissions/edit', '', 1, '2018-03-30 16:44:33', NULL);
INSERT INTO `admin_permission` VALUES (9, 5, '删除', 3, 'backend_system_upms_permissions_deletePermission', '/backend/system/upms/permissions/deletePermission', '', 1, '2018-03-30 16:46:56', NULL);
INSERT INTO `admin_permission` VALUES (10, 5, '禁用', 3, 'backend_system_upms_permissions_updataDisablePermissionId', '/backend/system/upms/permissions/updataDisablePermissionId', '', 1, '2018-03-30 16:52:33', NULL);
INSERT INTO `admin_permission` VALUES (11, 20, '角色管理', 2, 'backend_system_upms_role_index', '/backend/system/upms/role/index', 'larry-jiaoseguanli', 1, '2018-03-30 16:56:16', NULL);
INSERT INTO `admin_permission` VALUES (12, 11, '添加', 3, 'backend_system_upms_role_add', '/backend/system/upms/role/add', '', 1, '2018-03-30 16:58:09', NULL);
INSERT INTO `admin_permission` VALUES (13, 11, '设置权限', 3, 'backend_system_upms_role_setting', '/backend/system/upms/role/setting', '', 1, '2018-03-30 16:58:40', NULL);
INSERT INTO `admin_permission` VALUES (15, 11, '删除', 3, 'backend_system_upms_role_delectRole', '/backend/system/upms/role/delectRole', '', 1, '2018-03-30 16:59:15', NULL);
INSERT INTO `admin_permission` VALUES (16, 20, '用户列表', 2, 'backend_system_upms_user_index', '/backend/system/upms/user/index', 'larry-yonghuliebiao', 1, '2018-03-30 17:02:00', NULL);
INSERT INTO `admin_permission` VALUES (17, 16, '添加', 3, 'backend_system_upms_user_add', '/backend/system/upms/user/add', '', 1, '2018-03-30 17:02:35', NULL);
INSERT INTO `admin_permission` VALUES (18, 16, '修改', 3, 'backend_system_upms_user_edit', '/backend/system/upms/user/edit', '', 1, '2018-03-30 17:03:10', NULL);
INSERT INTO `admin_permission` VALUES (19, 16, '删除', 3, 'backend_system_upms_user_delectUser', '/backend/system/upms/user/delectUser', '', 1, '2018-03-30 17:05:09', NULL);
INSERT INTO `admin_permission` VALUES (20, 3, '系统用户设置', 1, '', '', 'larry-paikexitong_yonghuguanli', 1, '2018-03-30 16:40:40', NULL);
INSERT INTO `admin_permission` VALUES (21, 16, '禁用', 3, 'backend_system_upms_user_disable', '/backend/system/upms/user/edit/updataDisableUserId', '', 1, '2018-04-02 16:20:44', NULL);
COMMIT;

-- ----------------------------
-- Table structure for admin_role
-- ----------------------------
DROP TABLE IF EXISTS `admin_role`;
CREATE TABLE `admin_role` (
  `role_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `name` varchar(20) DEFAULT NULL COMMENT '角色名称',
  `title` varchar(20) DEFAULT NULL COMMENT '角色标题',
  `description` varchar(1000) DEFAULT NULL COMMENT '角色描述',
  `ctime` datetime NOT NULL COMMENT '创建时间',
  `orders` bigint(20) NOT NULL COMMENT '排序',
  PRIMARY KEY (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COMMENT='角色';

-- ----------------------------
-- Records of admin_role
-- ----------------------------
BEGIN;
INSERT INTO `admin_role` VALUES (16, '超级管理员', '所有权限', '所有权限', '2018-03-30 17:13:34', 0);
INSERT INTO `admin_role` VALUES (17, '管理员', '一般的管理员', '一般的管理员', '2018-03-30 17:14:35', 2);
COMMIT;

-- ----------------------------
-- Table structure for admin_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `admin_role_permission`;
CREATE TABLE `admin_role_permission` (
  `role_permission_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `role_id` int(10) unsigned NOT NULL COMMENT '角色编号',
  `permission_id` int(10) unsigned NOT NULL COMMENT '权限编号',
  PRIMARY KEY (`role_permission_id`),
  KEY `FK_Reference_23` (`role_id`),
  CONSTRAINT `FK_Reference_23` FOREIGN KEY (`role_id`) REFERENCES `admin_role` (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=193 DEFAULT CHARSET=utf8mb4 COMMENT='角色权限关联表';

-- ----------------------------
-- Records of admin_role_permission
-- ----------------------------
BEGIN;
INSERT INTO `admin_role_permission` VALUES (142, 17, 3);
INSERT INTO `admin_role_permission` VALUES (143, 17, 4);
INSERT INTO `admin_role_permission` VALUES (144, 17, 5);
INSERT INTO `admin_role_permission` VALUES (145, 17, 6);
INSERT INTO `admin_role_permission` VALUES (146, 17, 7);
INSERT INTO `admin_role_permission` VALUES (147, 17, 8);
INSERT INTO `admin_role_permission` VALUES (148, 17, 9);
INSERT INTO `admin_role_permission` VALUES (149, 17, 10);
INSERT INTO `admin_role_permission` VALUES (150, 17, 11);
INSERT INTO `admin_role_permission` VALUES (151, 17, 12);
INSERT INTO `admin_role_permission` VALUES (152, 17, 13);
INSERT INTO `admin_role_permission` VALUES (153, 17, 15);
INSERT INTO `admin_role_permission` VALUES (154, 17, 16);
INSERT INTO `admin_role_permission` VALUES (155, 17, 17);
INSERT INTO `admin_role_permission` VALUES (156, 17, 18);
INSERT INTO `admin_role_permission` VALUES (157, 17, 19);
INSERT INTO `admin_role_permission` VALUES (175, 16, 3);
INSERT INTO `admin_role_permission` VALUES (176, 16, 4);
INSERT INTO `admin_role_permission` VALUES (177, 16, 20);
INSERT INTO `admin_role_permission` VALUES (178, 16, 5);
INSERT INTO `admin_role_permission` VALUES (179, 16, 6);
INSERT INTO `admin_role_permission` VALUES (180, 16, 7);
INSERT INTO `admin_role_permission` VALUES (181, 16, 8);
INSERT INTO `admin_role_permission` VALUES (182, 16, 9);
INSERT INTO `admin_role_permission` VALUES (183, 16, 10);
INSERT INTO `admin_role_permission` VALUES (184, 16, 11);
INSERT INTO `admin_role_permission` VALUES (185, 16, 12);
INSERT INTO `admin_role_permission` VALUES (186, 16, 13);
INSERT INTO `admin_role_permission` VALUES (187, 16, 15);
INSERT INTO `admin_role_permission` VALUES (188, 16, 16);
INSERT INTO `admin_role_permission` VALUES (189, 16, 17);
INSERT INTO `admin_role_permission` VALUES (190, 16, 18);
INSERT INTO `admin_role_permission` VALUES (191, 16, 19);
INSERT INTO `admin_role_permission` VALUES (192, 16, 21);
COMMIT;

-- ----------------------------
-- Table structure for admin_user
-- ----------------------------
DROP TABLE IF EXISTS `admin_user`;
CREATE TABLE `admin_user` (
  `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `username` varchar(20) NOT NULL COMMENT '帐号',
  `password` varchar(32) NOT NULL COMMENT '密码MD5(密码+盐)',
  `salt` varchar(32) DEFAULT NULL COMMENT '盐',
  `realname` varchar(20) DEFAULT NULL COMMENT '姓名',
  `avatar` varchar(150) DEFAULT NULL COMMENT '头像',
  `phone` varchar(20) DEFAULT NULL COMMENT '电话',
  `email` varchar(50) DEFAULT NULL COMMENT '邮箱',
  `sex` tinyint(4) DEFAULT NULL COMMENT '性别(1:男,2:女)',
  `locked` tinyint(4) DEFAULT NULL COMMENT '状态(0:正常,1:锁定)',
  `ctime` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COMMENT='管理员用户';

-- ----------------------------
-- Records of admin_user
-- ----------------------------
BEGIN;
INSERT INTO `admin_user` VALUES (13, 'admin', 'be4af9cbc7f9c116e9918f117b5c96d8', 'b6cb0f2123f04514973d34258370387a', '孙达', 'http://image.sundablog.com/aa4fda29138b4d929528248b0e72377f.jpg', '18211102099', '18211102099@163.com', 1, 0, '2018-03-30 17:15:58');
COMMIT;

-- ----------------------------
-- Table structure for admin_user_role
-- ----------------------------
DROP TABLE IF EXISTS `admin_user_role`;
CREATE TABLE `admin_user_role` (
  `user_role_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户编号',
  `role_id` int(10) DEFAULT NULL COMMENT '角色编号',
  PRIMARY KEY (`user_role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COMMENT='用户角色关联表';

-- ----------------------------
-- Records of admin_user_role
-- ----------------------------
BEGIN;
INSERT INTO `admin_user_role` VALUES (14, 13, 16);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
